package models

import (
	"time"

	"github.com/amir-the-h/okex"
)

type Ticker struct {
	ID        uint             `gorm:"primaryKey;comment:自增主键"`
	InstType  string           `gorm:"type:varchar(20);comment:产品类型"`
	InstID    string           `gorm:"index;type:varchar(20);comment:产品ID，如BTC-USD-SWAP"`
	Last      okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:最新成交价"`
	LastSz    okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:最新成交的数量"`
	AskPx     okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:卖一价"`
	AskSz     okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:卖一价对应的数量"`
	BidPx     okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:买一价"`
	BidSz     okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:买一价对应的数量"`
	Open24h   okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:24小时开盘价"`
	High24h   okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:24小时最高价"`
	Low24h    okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:24小时最低价"`
	VolCcy24h okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:24小时成交量，以币为单位。如果是衍生品合约，数值为交易货币的数量"`
	Vol24h    okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:24小时成交量，以张为单位。如果是衍生品合约，数值为合约的张数"`
	SodUtc0   okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:UTC 0 时开盘价"`
	SodUtc8   okex.JSONFloat64 `gorm:"type:decimal(20,8);comment:UTC+8 时开盘价"`
	CreatedAt time.Time        `gorm:"index;comment:数据创建时间"`
}
